package homework;

import java.util.Scanner;

public class test11 {
    //由命令行输入一个4位整数，求将该数反转以后的数，如原数为1234，反转后的数位4321
    //思路：同第9题，提取成单个的数字，在乘以对应进制的10相加后可得到结果
    public static void main(String[] args) {
        System.out.println("请输入一个四位数的数字");
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = a / 1000;
        int c = a / 100 % 10;
        int d = a / 10 % 10;
        int e = a % 10;
/*        Integer[] array = new Integer[4];
        array[3] = b;
        array[2] = c;
        array[1] = d;
        array[0] = e;
        for (int i:array
             ) {
            System.out.println(i);
        }*/
        int k = 1;
        k = k * b + k * c * 10 + k * d * 100 + k * e * 1000;
        System.out.println(k);
    }
}
